﻿using MrPP.iot;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace MrPP.SerriedCabinet
{

    public class ActiveColumnPositionsFactory : GDGeek.Singleton<ActiveColumnPositionsFactory>, IEventFactory
    {

        public Action<Data> onRecevie
        {
            get;
            set;
        }
        [System.Serializable]
        public class Data
        {
            public int area;
            public int[] positions;
        }
        public string type => "activeColumnPositions";
    
        public void post(string data)
        {
            Data evt = JsonUtility.FromJson<Data>(data);
       //    Debug.LogError(JsonUtility.ToJson(evt));

            onRecevie?.Invoke(evt);
        }
    }
}